﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

using ProjectBase.Core;

namespace Survey.Common.Data
{
    /// <summary>
    ///     Base interface to be extended for the project purposes
    ///     Every method which is common for all entity data storage
    ///     should go here
    /// </summary>
    /// <typeparam name = "T">the templated entity with ID of the 'IdT' type,
    ///     to be get or set from/into the storage</typeparam>
    /// <typeparam name = "TID">type of the ID</typeparam>
    /// <typeparam name = "TFilter"></typeparam>
    public interface IBaseDao<T, in TID, in TFilter> : IEntityDao<T, TID, TFilter>
        where T : class, IPersistentObjectWithTypedId<TID>
        where TFilter : class, IFilter<TID>
    {
        /// <summary>
        ///     Uniqueness Check - Sometimes is useful to filter for existing entities
        ///     which are different from current entity (add or update)
        ///     Appends condition entity.ID &lt;&gt; exceptID
        /// </summary>
        /// <param name = "filter">Searching parameters</param>
        /// <param name = "exceptID">The ID which should be excepted from the searched list</param>
        /// <returns>The filtered list without entity of provided ID</returns>
        IEnumerable<T> Find(TID exceptID, TFilter filter);
    }
}